<template>
  <div>
    <ul class="card_con">
      <li
        class="card_li"
        v-for="(item, index) in cardArr"
        :key="index"
        :class="{ cur: item.count > 0 }"
      >
        <p>{{ item.name }}</p>
        <div>{{ item.count }}</div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "Card",
  props: ["cardArr"],
  methods: {},
  mounted() {},
};
</script>

<style lang="scss">
.type2_2 {
  .card_con {
    position: relative;
    top: 0rem;
    left: 0rem;
    height: 1.88rem;
    margin:.3rem 0 0.8rem .3rem;
  }
}

.card_con {
  position: absolute;
  top: 8rem;
  left: 0.3rem;
  .card_li {
    position: relative;
    width: 1.59rem;
    height: 1.88rem;
    background: url(../assets/images/card_li.png) no-repeat 0 0 / contain;
    float: left;
    margin-right: 0.18rem;
    &.cur {
      background: url(../assets/images/card_li_cur.png) no-repeat 0 0 / contain;
      p {
        color: #ee8a5c;
      }
    }
    p {
      width: 0.36rem;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-60%, -50%);
      line-height: 1.2;
      font-size: 0.3rem;
      text-align: center;
      font-weight: 600;
      color: #b49f96;
    }
    div {
      position: absolute;
      width: 0.42rem;
      height: 0.42rem;
      bottom: 0;
      right: 0;
      line-height: 0.42rem;
      text-align: center;
      color: #fff;
      font-size: 0.28rem;
      font-weight: 600;
    }
  }
}
</style>
